<!DOCTYPE html>
<html>
<head>
    {include file="public/head"}
</head>
<body>
<div class="g-flexview">
    <header class="m-navbar">
        <a href="javascript:history.back();" class="navbar-item">
            <i class="back-ico"></i>
        </a>
        <div class="navbar-center"><span class="navbar-title">支付宝绑定</span></div>
    </header>
    <div class="g-scrollview">
        <div class="m-cell">
            <div class="cell-item">
                <div class="cell-left">支付宝昵称：</div>
                <div class="cell-right">
                    <input type="text" class="cell-input" placeholder="请输入支付宝昵称" autocomplete="off" id="nickname"/>
                </div>
            </div>
            <div class="cell-item">
                <div class="cell-left">支付宝账户：</div>
                <div class="cell-right">
                    <input type="text" class="cell-input" placeholder="请输入支付宝账户" autocomplete="off" id="account"/>
                </div>
            </div>
        </div>
        <p style="color: #999;text-align: center;">注:支付宝账户绑定成功后,不可二次更改,如需更改,请联系客服</p>
    </div>
    <button type="button" class="btn-block btn-primary" id="modify_nickname">立即绑定</button>
</div>
{include file="public/js"}
<script>
    !function ($) {
        $('#modify_nickname').click(function () {
            dialog.confirm('提示','立即绑定?',function () {
                dialog.loading.open('处理中...');
                $.post('/index/user/saveAlipay',{nickname : $('#nickname').val(),account : $('#account').val()},function (res) {
                    dialog.loading.close();
                    dialog.toast(res.msg,'none',1000);
                });
            });
        });
    }(jQuery);
</script>
</body>
</html>